<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>寻梦环游记</title>
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <script src="js/respond.min.js"></script>
  <![endif]-->
  <style>
    .banner{
      height: 273px;
      margin-bottom: 40px;
    }
    .banner img {
      border-radius: 3px;
      width: 100%;
    }
    #summary-container .col-md-3 .course-item {
      margin:0 auto;
      text-align: left;
      width: 230px;
      line-height: 20px;
      font-size: 14px;
    }
    #summary-container img {
      width: 100%;
      padding-bottom: 10px;
    }
    .divider {
      margin: 20px 0;
    }
  </style>
  <script src="js/jquery-1.11.1.min.js"></script>
</head>
<body>
  <!-- 主要内容 -->
  <div class="container">
    <div class="banner">
      <a href="index.html"><img class="banner__img" src="images/ts/xunmeng.jpg" /></a>
    </div>
    <div class="row course" id="summary-container">
      <div class="col-md-3">
        <div class="course-item">
          <img class="course-img img-rounded" src="images/ts/vue.jpg" alt="vue">
          <p class="course-desc">Vue2.5开发去哪儿网App</p>
          <p class="course-desc">当前课程学习人数：62</p>
        </div>
      </div>
      <div class="col-md-3">
        <div class="course-item">
          <img class="course-img img-rounded" src="images/ts/react.jpg" alt="react">
          <p class="course-desc">React开发简书项目</p>
          <p class="course-desc">当前课程学习人数：90</p>
      </div>
      </div>
      <div class="col-md-3">
        <div class="course-item">
          <img class="course-img img-rounded" src="images/ts/ssr.jpg" alt="ssr">
          <p class="course-desc">React服务器渲染原理解析与实践</p>
          <p class="course-desc">当前课程学习人数：35</p>
        </div>
      </div>
      <div class="col-md-3">
        <div class="course-item">
          <img class="course-img img-rounded" src="images/ts/webpack.jpg" alt="webpack">
          <p class="course-desc">手把手带你掌握新版Webpack4.0</p>
          <p class="course-desc">当前课程学习人数：85</p>
        </div>
      </div>
    </div>

    <hr class="divider">
  </div>

  <script src="js/bootstrap.min.js"></script>
  <script>
    $(function(){
      $('.course-item').each(function(index, element){
        var num = random(10, 99);
        var desc = $(element).find('.course-desc:eq(1)').html('当前课程学习人数：' + num);
      });
    })
    // 某范围之内的随机数
    function random(min, max) {
      return Math.floor(Math.random() * (max - min)) + min;
    }
  </script>
</body>
</html>